Diff with RichText

Hello!

I used the DIFF Example of the dxl reference with two Buffers to compare a new and a history value with redlining. (i wanted to enhance the smart history viewer from smart dxl).

However when i assign the resulting buffer the rich text tags are printed out in the rich text box like text (see attached screenshot).

What can i do to not show RTF code in the new value field?

Hier is the code i manipulated (result see attached file):
if (find(skipNewValues, record, sNew))
{
// set(dbeNewValue, sNew)

if (find(skipOldValues, record, sOld))
{
set(dbeOldValue, sOld)
}
Buffer buff1 = create()
Buffer buff2 = create()
Buffer resBuf = create()
buff1 = sOld
buff2 = sNew
diff(resBuf, buff1, buff2, "\\cf1\\strike ", "\\cf3\\ul ")

useRTFColour(dbeNewValue, true)
string theDiff = tempStringOf resBuf;

set(dbeNewValue, theDiff)

delete resBuf
delete buff1
delete buff2
}
Bjoern_Karpenstein - Wed Aug 08 10:33:01 EDT 2012

Re: Diff with RichText
Mathias Mamsch - Sat Aug 11 12:17:38 EDT 2012

If you are evaluating the history you can probably use (without having tried it):
 

// found the following perms: 
// HAValue_ plainOldValue ()
// HAValue_ plainNewValue ()
// should translate to 
 
History h
for h in obj do {
  Buffer buf1 = create(); buf1 = h.plainOldValue
  Buffer buf2 = create(); buf2 = h.plainNewValue
  Buffer bufDiff = create(); 
  diff(bufDiff, buf1, buf2) 
 
  // do something with the results ...
}

 


Maybe that helps, Regards, Mathias

 

 


Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS